package org.modulefusion.example.ipojo.simple;

import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Requires;
import org.osgi.framework.Bundle;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;

/**
 * Example class that uses a OSGi service
 * 
 * @author clement@apache.org (clement escoffier)
 */
@Component(immediate=true)
public class UsingAService {
    
    @Requires
    private PackageAdmin packageAdmin;
	
	public UsingAService() {
		ExportedPackage[] packages = packageAdmin.getExportedPackages((Bundle) null);
		System.out.println("----------------------");
		System.out.println("Simple iPOJO Examples");
		System.out.println("----------------------");
		System.out.println("Number of exported packages in the framework: " + packages.length);
		System.out.println("----------------------");
	}
	
}
